home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 123
/
(Vol 123) Jan 13 2011.iso
/
Games
/
island_fishing.swf
/
scripts
/
DefineSprite_147
/
frame_2
/
DoAction.as
< prev
Wrap
Text File
|
2011-01-13
|
750b
|
39 lines
acceleration = 10;
newpos = function()
{
ranx = Math.round(Math.random() * 550);
rany = Math.round(Math.random() * 400);
};
newpos();
this.onEnterFrame = function()
{
if(hooked <= 0)
{
if(ranx > this._x)
{
this._xscale = -100;
}
if(ranx < this._x)
{
this._xscale = 100;
}
this._x += (ranx - this._x) / acceleration;
if(this._y > 190)
{
this._y += (rany - this._y) / acceleration;
if(rany <= 175)
{
newpos();
}
}
else
{
this._y += 1;
}
if(Math.round(this._x) == ranx || Math.round(this._y) == rany)
{
newpos();
}
}
};